package com.simple_factory2;

public class Main {
    public static void main(String[] args) {
        //生产一杯可乐
        Drink coke = DrinkFactory.produceDrink("coke");
        coke.drink();
        //生产一杯雪碧
        Drink spite = DrinkFactory.produceDrink("spite");
        spite.drink();
        //生产一杯雪碧
        Drink duice = DrinkFactory.produceDrink("duice");
        duice.drink();
        System.out.println("--------------------------------");
        //生产一个没有的产品
        Drink water = DrinkFactory.produceDrink("柠檬水");
        if(water!=null){
            water.drink();
        }
    }
}
